import request from '@/utils/request';

// 获取验证码
export const getCodeCheckAPI = (phone) => {
    return request.get(`/sms/send/${phone}`);
}

// 登录接口
export const loginAPI = (data) => {
    return request.post('/user/login', data)
}

// 获取账号下就诊人信息
export const getPatientAPI = () => {
    return request.get(`/user/patient/auth/findAll`)
}

// 添加就诊人
export const addPatientAPI = (data) => {
    return request.post(`/user/patient/auth/save`,data)
}

// 获取当前账号认证信息
export const getAuthInfoAPI = () => {
    return request.get(`/user/auth/getUserInfo`)
}

// 获取证件类型
export const getCertificatesTypeAPI = (dictCode ='CertificatesType') => {
    return request.get(`/cmn/dict/findByDictCode/${dictCode}`)
}

// 实名认证提交
export const submitAuthInfoAPI = (data) => {
    return request.post(`/user/auth/userAuah`,data)
}

// 获取地址数据
export const getAddressListAPI = (parentId = 86) => {
    return request.get(`/cmn/dict/findByParentId/${parentId}`)
}

// 获取就诊人详情
export const getPatientDetailAPI = (id) => {
    return request.get(`/user/patient/auth/get/${id}`)
}

// 编辑就诊人
export const editPatientAPI = (data) => {
    return request.put(`/user/patient/auth/update`,data)
}

// 删除就诊人
export const deletePatientAPI = (id) => {
    return request.delete(`/user/patient/auth/remove/${id}`)
}